var jslist = fs.lsAll(__dirname + "/../middleware");
var eventlist = jslist.filter(function(fileName) {
	return fileName.endWith(".on.js");
});
//中间件的事件注册器
var EventEmitter = events.EventEmitter;
var midEvent = new EventEmitter();
global.midEvent = midEvent;

module.exports = function(app) {
	eventlist.forEach(function(fileName) {
		require(fileName);
	});
	console.log("系统事件注册成功");
};